package j2.shopmail;

import android.view.View;
import android.widget.ProgressBar;
import com.alibaba.fastjson.JSON;

import java.util.List;

public class OrderBaseInfo
{
   public static List<OrderBaseInfo> obj;
   public static void getOrderList(String userID, final ProgressBar bar)
   {
       final AsycHttp<String, List<OrderBaseInfo>> http=new AsycHttp<>();
       http.setUIItem(bar);
       http.setBackgroundAction(new AsycHttpAction<String,List<OrderBaseInfo>>() {
           @Override
           public List<OrderBaseInfo> BackGroundAction(String... params)
           {
               String c= ServerHelper.MakeGetOrderListStr(params[0]);
               String string =HttpHelper.Get(c);
               http.PushProgress(80);
               List<OrderBaseInfo> array = JSON.parseArray(string, OrderBaseInfo.class);
               return array;
           }
        
           @Override
           public void ProgressUpdateAction(View UI, Double... values)
           {
               ((ProgressBar)UI).setProgress(values[0].intValue());
           }
        
           @Override
           public void ResultFunction(List<OrderBaseInfo> result)
           {
               obj=result;
               OrderActivity.listView.setAdapter(OrderActivity.adp);
               bar.setProgress(100);
               bar.setVisibility(View.GONE);
               
           }
        
           @Override
           public void PreDoFunction()
           {
               bar.setProgress(0);
               bar.setVisibility(View.VISIBLE);
           }
       });
       http.execute(userID);
   }
    String UserID ;
    String OrderID ;
    int isFinsh ;
    
    public int getIsFinsh()
    {
        return isFinsh;
    }
    
    public String getOrderID()
    {
        return OrderID;
    }
    
    public String getUserID()
    {
        return UserID;
    }
    
    public void setUserID(String userID)
    {
        UserID = userID;
    }
    
    public void setOrderID(String orderID)
    {
        OrderID = orderID;
    }
    
    public void setIsFinsh(int isFinsh)
    {
        this.isFinsh = isFinsh;
    }
}